from math import ceil


def isPrime(n):
    if n == 2:
        return True
    else:
        for i in range(2, ceil(n**0.5)+1):
            if not (n % i):
                return False
        return True


def getPrimeNums(num):
    ans = []
    for i in range(2, ceil(num**0.5)+1):
        if isPrime(i):
            ans.append(i)
    return ans


def decompose(num):
    i = 2
    primeNums = getPrimeNums(num)
    ans = []

    for i in primeNums:
        while not (num % i):
            num /= i
            ans.append(int(i))
        if num == 1:
            break

    if num != 1:
        ans.append(int(num))

    return ans


num = int(input())
for i in decompose(num):
    print(i, end=' ')
